#include"list.h"
namespace Cw
{
	template<class Container>
	void print_Container(const Container& con)
	{
		typename Container::const_iterator it = con.begin();
		while (it != con.end())
		{
			cout << *it << " ";
			++it;
		}
		cout << endl;
		for (auto e : con)
		{
			cout << e << " ";
		}
		cout << endl;
	}
	void test()
	{
		List<int> lt;
		lt.push_back(1);
		lt.push_back(2);
		lt.push_back(3);
		lt.push_back(4);
		lt.push_back(5);
		lt.push_back(6);
		lt.push_back(7);
		List<int> ::iterator it = lt.begin();
		/*while (it != lt.end())
		{
			cout << *it << " ";
			++it;
		}
		cout << endl;
		print_Container(lt);*/

		while (it != lt.end() )
		{
			if (*it % 2 != 0)
			{
				it = lt.erase(it);
			}
			else
			{
				++it;
			}
		}
		print_Container(lt);
		List<int> lt1({ 1, 2,3,4,5,6,7,8,9,10});
		print_Container(lt1);
		

	}
}

int main()
{
	Cw::test();
	return 0;
}